<template>
	<view class="person-container">
		<u-cell-group>
			<u-cell title="用户账号" :value="userInfo.userPhone"></u-cell>
			<u-cell title="用户姓名" :value="userInfo.userName"></u-cell>
			<u-cell title="用户性别" :value="translateSex(userInfo.userGender)"></u-cell>
			<u-cell title="用户地址" :value="userInfo.userAddress"></u-cell>
			<u-cell title="所在学院" :value="userInfo.userCollege"></u-cell>
			<u-cell title="入学年份" :value="userInfo.userEnterYear+'年'"></u-cell>
			<u-cell title="用户角色" :value="translateRole(userInfo.userRole)"></u-cell>
		</u-cell-group>
		<view class="card-box">
			<text>学生证照</text>
			<image :src="userInfo.userStudentCard" mode="" class="card"></image>
		</view>
		<view class="bottom">
			 
			<view class="operation">

				<view class="button">
					<u-button text="维护个人信息" shape="circle" @click="submit"
						color="linear-gradient(135.00deg, rgba(118,118,238,1.00) 0.321%,rgba(138,138,238,1.00) 100%)"></u-button>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: this.$store.getters?.userInfo?.userInfoDetail || null,

			};
		},
		onLoad() {

		},
		methods: {
			translateSex(value) {
				//用户性别：1:男，0:女
				let desc = ''
				switch (value) {
					case 1:
						desc = '男'
						break;
					case 0:
						desc = '女'
						break;


				}
				return desc
			},
			translateRole(value) {
				//用户角色：0 普通用户 1 配送员 2 管理员
				let desc = ''
				switch (value) {
					case 1:
						desc = '配送员'
						break;
					case 0:
						desc = '普通用户'
						break;
					case 2:
						desc = '管理员'
						break;

				}
				return desc
			},


		}
	}

</script>

<style lang="scss">
	.person-container {
		height: 100vh;
		background: #fff;
		padding: 15px;
	}

	::v-deep .u-cell__body {
		height: 50px;
	}

	.card-box {
		margin-top: 10px;
		padding: 15px;
		font-size: 15px;
		line-height: 22px;
		color: #303133;
	}

	.card {
		width: 100%;
		height: 200px;
		margin-top: 10px;
		border: 1px solid #eceae2;
		border-radius: 8px;
	}

	.bottom {
		height: 90px;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		width: 100%;
		bottom: 10px;
		position: fixed;

		.operation {
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: calc(100% - 30px);

		}

		.text {
			color: rgb(51, 51, 51);
			font-size: 14px;
		}



		.button {
			width: 100%
		}
	}

</style>

